<?php

namespace admin\modules\system\models\forms;

use Yii;
use yii\base\Model;
use yii\data\ActiveDataProvider;
use yii\db\ActiveQuery;
use yii\db\Expression;
use yii\helpers\ArrayHelper;
use admin\models\db\Banners as BannersModel;

/**
* Banners represents the model behind the search form about `admin\models\db\Banners`.
*/
class Banners extends BannersModel
{
    public function attributeLabels()
    {
        $attributeLabels = parent::attributeLabels();
        $attributeLabels = ArrayHelper::merge($attributeLabels, []);
        return $attributeLabels;
    }

    public function rules()
    {
        $rules = parent::rules();
        /*foreach ($rules as $k => $v) {
            if ($v[1] == 'required'){
                $rules[$k][0] = array_diff($rules[$k][0], ['url']);
            }
        }*/
        $rules = ArrayHelper::merge($rules, [
//            [['excelFile'],'file', 'skipOnEmpty' => true, 'extensions' => 'csv,xls,xlsx'],
        ]);
        return $rules;
    }
}
